package com.batch.quartz.reader;

import com.batch.quartz.entity.Person;
import org.springframework.batch.item.ItemProcessor;

/**
 * <h3>partitionjob</h3>
 * <p>PersonItemProcessor</p>
 *
 * @author : hduong
 * @version : 1.0
 * @date : 2019-12-20 14:51
 **/
public class PersonItemProcessor implements ItemProcessor<Person, Person> {

    public Person process(final Person person) throws Exception {
        final String firstName = person.getFirstName().toUpperCase();
        final String lastName = person.getLastName().toUpperCase();
        final Person transformedPerson = new Person(firstName, lastName);
        System.out.println("Converting (" + person + ") into ("
                + transformedPerson + ")");
        return transformedPerson;
    }

}